package com.tpc.control.jpa;

import java.sql.Timestamp;
import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * ReserveItemLabAnswer entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "reserve_item_lab_answer", catalog = "production_control")
public class ReserveItemLabAnswer implements java.io.Serializable {

	// Fields

	private ReserveItemLabAnswerId id;
	private ReserveItem reserveItem;
	private ReserveItemLab reserveItemLab;
	private Date reserveLabDate;
	private String remark;
	private Timestamp createDate;
	private String createBy;

	// Constructors

	/** default constructor */
	public ReserveItemLabAnswer() {
	}

	/** minimal constructor */
	public ReserveItemLabAnswer(ReserveItemLabAnswerId id,
			ReserveItem reserveItem, ReserveItemLab reserveItemLab,
			Timestamp createDate, String createBy) {
		this.id = id;
		this.reserveItem = reserveItem;
		this.reserveItemLab = reserveItemLab;
		this.createDate = createDate;
		this.createBy = createBy;
	}

	/** full constructor */
	public ReserveItemLabAnswer(ReserveItemLabAnswerId id,
			ReserveItem reserveItem, ReserveItemLab reserveItemLab,
			Date reserveLabDate, String remark, Timestamp createDate,
			String createBy) {
		this.id = id;
		this.reserveItem = reserveItem;
		this.reserveItemLab = reserveItemLab;
		this.reserveLabDate = reserveLabDate;
		this.remark = remark;
		this.createDate = createDate;
		this.createBy = createBy;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "reserveNo", column = @Column(name = "reserve_no", nullable = false, length = 20)),
			@AttributeOverride(name = "reserveLine", column = @Column(name = "reserve_line", nullable = false)),
			@AttributeOverride(name = "reserveLabNo", column = @Column(name = "reserve_lab_no", nullable = false)),
			@AttributeOverride(name = "reserveLabAnswerNo", column = @Column(name = "reserve_lab_answer_no", nullable = false)) })
	public ReserveItemLabAnswerId getId() {
		return this.id;
	}

	public void setId(ReserveItemLabAnswerId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "reserve_no", referencedColumnName = "reserve_no", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "reserve_line", referencedColumnName = "reserve_line", nullable = false, insertable = false, updatable = false) })
	public ReserveItem getReserveItem() {
		return this.reserveItem;
	}

	public void setReserveItem(ReserveItem reserveItem) {
		this.reserveItem = reserveItem;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "reserve_no", referencedColumnName = "reserve_no", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "reserve_line", referencedColumnName = "reserve_line", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "reserve_lab_no", referencedColumnName = "reserve_lab_no", nullable = false, insertable = false, updatable = false) })
	public ReserveItemLab getReserveItemLab() {
		return this.reserveItemLab;
	}

	public void setReserveItemLab(ReserveItemLab reserveItemLab) {
		this.reserveItemLab = reserveItemLab;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "reserve_lab_date", length = 10)
	public Date getReserveLabDate() {
		return this.reserveLabDate;
	}

	public void setReserveLabDate(Date reserveLabDate) {
		this.reserveLabDate = reserveLabDate;
	}

	@Column(name = "remark", length = 65535)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "create_date", nullable = false, length = 19)
	public Timestamp getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}

	@Column(name = "create_by", nullable = false, length = 20)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

}